package service.impl;

import bean.CommodityBean;
import dao.BaseDao;
import dao.CommodityDao;
import dao.impl.CommodityDaoImpl;
import entity.Commodity;
import service.CommodityService;

import java.util.List;

public class CommodityServiceImpl extends BaseDao implements CommodityService {
    CommodityDao commodityDao = new CommodityDaoImpl();

    @Override
    public List<Commodity> findAllByName(String name) {
        return commodityDao.findAllByName(name);
    }

    @Override
    public List<CommodityBean> findAllMsg() { return commodityDao.findAllMsg(); }

    @Override
    public List<Commodity> findScorePage(String name, int startPage, int limit) {
        return commodityDao.findScorePage(name,startPage,limit);
    }

    @Override
    public Commodity findById(int id) {
        return commodityDao.findById(id);
    }
    @Override
    public List<CommodityBean> findAllByNameAndClass(String name, String id, int startPage, int limit) {
        return commodityDao.findAllByNameAndClass(name,id,startPage,limit);
    }

    @Override
    public int delId(int id) {
        return commodityDao.delId(id);
    }

    @Override
    public int findCountPage(String name, String id) {
        return commodityDao.findCountPage(name,id);
    }

    @Override
    public int addAll(Commodity commodity) {
        return commodityDao.addAll(commodity);
    }

    @Override
    public List<Commodity> findId(int id) {
        return commodityDao.findId(id);
    }

    @Override
    public int update(Commodity commodity) {
        return commodityDao.update(commodity);
    }
}
